package A06Runtime;

import java.io.IOException;

public class Test {
    public static void main(String[] args) throws IOException {
        Runtime rt = Runtime.getRuntime();//获取当前运行环境对象
        System.out.println(rt.availableProcessors());//可运行线程数
        System.out.println(rt.freeMemory());//pvm剩余可用内存
        System.out.println(rt.totalMemory());//pvm已调用内存
        System.out.println(rt.maxMemory());//pvm可占用最大内存，单位均为字节
        rt.exec("notepad");
        rt.exit(0);//退出虚拟机，0为正常退出，其他数字为异常退出
    }
}
